package cn.jannal.lock.dao;

import org.apache.ibatis.annotations.Param;

import cn.jannal.lock.pojo.ProductStock;

public interface ProductStockMapper {
    public int insert(ProductStock productStock);
    
    public int updateProductNumById(@Param("productNum")Long productNum,@Param("id")Long id);
    
    public int updateProductNumByProductId(@Param("productNum")Long productNum,@Param("productId")Long productId);
    
    public ProductStock findById(@Param("id")Long id);
    
    public ProductStock findByProductId(@Param("productId")Long productId);
    
    public ProductStock findByIdForUpdate(@Param("productId")Long productId);

    public int updateMinusStockByProductId3(@Param("productNum")Long productNum,@Param("productId")Long productId);
    
    
    public int updateMinusStockByProductId(@Param("productNum")Long productNum,@Param("productId")Long productId,@Param("version") Long version);
    
    public int updateMinusStockByProductId2(@Param("productNum")Long productNum,@Param("productId")Long productId,@Param("version") Long version);
}
